README

Countering Non-Ignorable Nonresponse in Survey Models with Randomized Response Instruments and Doubly Robust Estimation
Michael A. Bailey
Political Analysis

All code is implemented via RStudio versions 2023.12.1 using R 4.3.2 with packages updated as of April 2024.

The file "Main.R" has the code that creates all figures and simulation data.  In the process of creating the figures, 
the information in the supplemental tables is reported in R console.

The code for MNAR weighting, imputation and doubly robust models is based on code made available in
supplemental material from Sun, B., L. Liu, W. Miao, K. Wirth, J.M. Robins, and E.J. Tchetgen-Tchetgen. 2018. 
Semiparametric estimation with data missing not at random using an instrumental variable. Statistica Sinica 28:1965�1983.

######################
## Folders
######################
code/          # Code to load data, functions and produce data for Figure 2 and .png files for Figures 3 through 7
code/functions # Functions used in analysis
code/simulationModules # Functions used in simulations
data/ 	       # Contains raw survey data results
figures/       # Contains all figures
	Figure 1. Simulation results for MNAR data
	Figure 2. Survey design for turnout analysis [created in Powerpoint]
	Figure 3. Analysis of turnout question
	Figure 4. Analysis of Trump approval
	Figure 5. Analysis of Trump approval by party
	Figure 6. Analysis of tax cuts question
	Figure 7. Analysis of race question
	Appendix Figure 1. Simulation results for MAR data
	Appendix Figure 2. Simulation results with weak instrument
results/       # Contains estimation results used in Figures 3 though 7
results/simulations # Contains simulation results used in Figure 1 and Appendix Figure 1 and Appendix Figure 2
tables/	       # Contains .csv files with tables (as produced in Main.R); Table A1 is an exception, which is self-contained example; it is created in LaTex.
	Table A2. Turnout: Doubly robust coefficient result
	Table A3. Trump approval, full population: Doubly robust coefficient results
	Table A4. Trump approval, Midwest: Doubly robust coefficient results
	Table A5. Trump approval, Democrats: Doubly robust coefficient results
	Table A6. Trump not strong disapproval, Democrats: Doubly robust coefficient results
	Table A7. Trump approval, Republicans: Doubly robust coefficient results
	Table A8. Trump strong approval, Republicans: Doubly robust coefficient results
	Table A9. Tax cut approval, all: Doubly robust coefficient results
	Table A10. Tax cut approval, Democrats: Doubly robust coefficient results
	Table A11. Tax cut not disapprove, Democrats: Doubly robust coefficient results
	Table A12. Tax cut approval, Republicans: Doubly robust coefficient results
	Table A13. Racial conservativism, all: Doubly robust coefficient results
	Table A14. Racial conservativism, Democrats: Doubly robust coefficient results
	Table A15. Racial conservativism, Republicans: Doubly robust coefficient results
	Table A16. Descriptive statistics: Averages and sample sizes